package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.util.AliOSSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * ClassName:UploadController
 * Package:com.itheima.controller
 * Description:
 *
 * @Author 老大
 * @Create 2024/5/6 11:52
 * @Version 1.0
 */
@RestController
public class UploadController {
    @Autowired
    AliOSSUtils aliOSSUtils;
    @PostMapping("/upload")
    public Result upload(MultipartFile image) throws Exception {
        String url = aliOSSUtils.upload(image);
        return Result.success(url);
    }
}
